/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Aslan
 */
@Entity
@Table(name = "questions")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Questions.findAll", query = "SELECT q FROM Questions q"),
    @NamedQuery(name = "Questions.findById", query = "SELECT q FROM Questions q WHERE q.id = :id"),
    @NamedQuery(name = "Questions.findByContent", query = "SELECT q FROM Questions q WHERE q.content = :content"),
    @NamedQuery(name = "Questions.findByTestId", query = "SELECT q FROM Questions q WHERE q.testId = :testId"),
    @NamedQuery(name = "Questions.findByAnswerA", query = "SELECT q FROM Questions q WHERE q.answerA = :answerA"),
    @NamedQuery(name = "Questions.findByAnswerB", query = "SELECT q FROM Questions q WHERE q.answerB = :answerB"),
    @NamedQuery(name = "Questions.findByAnswerC", query = "SELECT q FROM Questions q WHERE q.answerC = :answerC"),
    @NamedQuery(name = "Questions.findByAnswerD", query = "SELECT q FROM Questions q WHERE q.answerD = :answerD"),
    @NamedQuery(name = "Questions.findByAnswerE", query = "SELECT q FROM Questions q WHERE q.answerE = :answerE"),
    @NamedQuery(name = "Questions.findByTrueAnswer", query = "SELECT q FROM Questions q WHERE q.trueAnswer = :trueAnswer")})
public class Questions implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "content")
    private String content;
    @Basic(optional = false)
    @Column(name = "test_id")
    private int testId;
    @Basic(optional = false)
    @Column(name = "answer_a")
    private String answerA;
    @Basic(optional = false)
    @Column(name = "answer_b")
    private String answerB;
    @Basic(optional = false)
    @Column(name = "answer_c")
    private String answerC;
    @Basic(optional = false)
    @Column(name = "answer_d")
    private String answerD;
    @Basic(optional = false)
    @Column(name = "answer_e")
    private String answerE;
    @Basic(optional = false)
    @Column(name = "true_answer")
    private int trueAnswer;

    public Questions() {
    }

    public Questions(Integer id) {
        this.id = id;
    }

    public Questions(Integer id, String content, int testId, String answerA, String answerB, String answerC, String answerD, String answerE, int trueAnswer) {
        this.id = id;
        this.content = content;
        this.testId = testId;
        this.answerA = answerA;
        this.answerB = answerB;
        this.answerC = answerC;
        this.answerD = answerD;
        this.answerE = answerE;
        this.trueAnswer = trueAnswer;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getTestId() {
        return testId;
    }

    public void setTestId(int testId) {
        this.testId = testId;
    }

    public String getAnswerA() {
        return answerA;
    }

    public void setAnswerA(String answerA) {
        this.answerA = answerA;
    }

    public String getAnswerB() {
        return answerB;
    }

    public void setAnswerB(String answerB) {
        this.answerB = answerB;
    }

    public String getAnswerC() {
        return answerC;
    }

    public void setAnswerC(String answerC) {
        this.answerC = answerC;
    }

    public String getAnswerD() {
        return answerD;
    }

    public void setAnswerD(String answerD) {
        this.answerD = answerD;
    }

    public String getAnswerE() {
        return answerE;
    }

    public void setAnswerE(String answerE) {
        this.answerE = answerE;
    }

    public int getTrueAnswer() {
        return trueAnswer;
    }

    public void setTrueAnswer(int trueAnswer) {
        this.trueAnswer = trueAnswer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Questions)) {
            return false;
        }
        Questions other = (Questions) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Questions[ id=" + id + " ]";
    }
    
}
